<?php

namespace Diablo7\HyperfPulsar\Message;

abstract class ConsumerMessage extends AbstractMessage implements ConsumerMessageInterface
{
    /**
     * @var bool
     */
    public $isEnable;
    /**
     * 订阅名
     * @var string
     */
    public $subscription = "";


    public function getSocketUri() :string
    {
        return sprintf(
            "ws/v2/consumer/persistent/%s/%s/%s/%s",
            $this->getTenant(),
            $this->getNamespace(),
            $this->getTopic(),
            $this->getSubscription()
        );
    }

    public function isEnable(): bool
    {
        return $this->isEnable;
    }

    public function getSubscription() :string
    {
        return $this->subscription;
    }
}